<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Education extends Model {
	public static $rules = [
		'name' => 'required|max:20',
		'major' => 'required|max:20',
		'edu' => 'required|max:12',
		'startDate' => 'required|integer:10',
		'endDate' => 'required|integer:10',
		'experience' => 'sometimes|max:1600',
	];
	public static $message = [
		'name.required' => '学校不能为空',
		'name.max' => '学校最多20个字符',
		'major.required' => '专业不能为空',
		'major.max' => '专业最多20个字符',
		'edu.required' => '学历不能为空',
		'edu.max' => '学历最多12个字符',
		'startDate.required' => '开始时间不能为空',
		'startDate.integer' => '开始时间格式不正确',
		'endDate.required' => '结束时间不能为空',
		'endDate.integer' => '结束时间格式不正确',
		'experience.max' => '在校经历最多1600个字符',
	];
	protected function getDateFormat() {
		return time();
	}
	protected $fillable = ['resume_id', 'name', 'major', 'edu', 'experience', 'start_date', 'end_date'];
}
